var cobj = null;
var cobj_value = null;
window.onload = function() 
{
	Athena_ptida(document.frmList.ptida,'ptidbb',true);
}
function Initalize_Child()
{
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			var str = xmlHttp.responseText;
			if(str != '')
			{
				var arr = str.split('|||');
				if(arr.length % 2 == 0)
				{
					for(i=0;i<arr.length;i=i+2)
					{
						var opp = document.createElement('OPTION');
						opp.value = arr[i];
						opp.text = arr[i+1];
						cobj.add(opp);
					}
					for(i=0;i<cobj.options.length;i++)
					{
						if(cobj.options[i].value == cobj_value)
						{
							cobj.selectedIndex = i;
							break;
						}
					}
				}
			}
			else
			{
				var opp = document.createElement('OPTION');			
				opp.value = "";
				opp.text = '选择二级分类';
				cobj.add(opp);
			}
		}
	}
}
function Athena_ptida(obj,cname,init)
{
	try
	{
		cobj = eval('document.frmList.'+ cname);
		if(init)
			cobj_value = cobj.value;
		while(cobj.options.length>0)
			cobj.options.remove(0);
		if(obj.value ==0 )
		{
			var opp = document.createElement('OPTION');			
			opp.value = "";
			opp.text = '选择二级分类';alert(cobj);
			cobj.add(opp);
		}
		else
		{
			var conn = new XHConn();
			conn.connect("/include/get_product_type.php",'GET',"ptida=" + obj.value,Initalize_Child);
		}
	}
	catch(e)
	{
		//alert(e.description);
	}
	
}